package com.pkuse.bjousystem.controller;

import com.pkuse.bjousystem.entity.school.ZwAuthEntity;
import com.pkuse.bjousystem.dto.school.SchoolName;
import com.pkuse.bjousystem.repository.school.SchoolRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/school/api/uncheck/")
public class SchoolUncheckController {
    @Autowired
    SchoolRepository schoolRepository;

    @Autowired
    ZwAuthEntity zwAuthEntity;

    @RequestMapping("/xxmc")
    public List<SchoolName> listXxmc() {
        List<SchoolName> schoolNames = schoolRepository.listXxmc();
        schoolNames.add(0, new SchoolName(zwAuthEntity.getAuthPassword(), true));
        return schoolNames;
    }
}
